#include <stdio.h>
#include <sys/time.h>
#include <assert.h>

typedef long long int int64_t ;
int64_t utv_count(struct timeval* tstart, struct timeval* tend)
{
    int64_t nusec;
    nusec = (int64_t)(tend->tv_sec-tstart->tv_sec)*(int64_t)1000000 + 
            (int64_t)(tend->tv_usec-tstart->tv_usec);

    return nusec;
}


int main()
{
    struct timeval tv1 = {0,0};
    struct timeval tv2;
    gettimeofday(&tv2, NULL);
    
    int64_t interval = utv_count(&tv1, &tv2);
    int64_t pts = (utv_count(&tv1, &tv2)*9/100);

    printf("interval : %lld.\n", interval);
    printf("pts      : %lld.\n", pts);

    return 0;
}
